﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ASApplication;
using FXnaWpfBase;

namespace ASPresentation
{
    public class ToolBarViewModel:FViewModel
    {

        public void Init()
        {
            GisService.CurrentService.MapModeChanged += new EventHandler(CurrentService_MapModeChanged);
        }


        void CurrentService_MapModeChanged(object sender, EventArgs e)
        {
            this.OnPropertyChanged("IsSelectON");

            this.OnPropertyChanged("IsPanOn");

            this.OnPropertyChanged("IsMoveOn");
            this.OnPropertyChanged("IsAddPointOn");

            


        }







        public bool IsSelectON
        {
            get
            {

                return GisService.CurrentService.MapMode == MapMode.Select;
            }


        }


        public bool IsMoveOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.Move;
            }


        }

        public bool IsPanOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.Pan;
            }


        }




        public bool IsAddPointOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.AddPoint;
            }


        }


        public bool IsAddLineOn
        {
            get
            {

                return GisService.CurrentService.MapMode == MapMode.AddLine;
            }

        }


        public bool IsAddPolyOn
        {

            get
            {

                return GisService.CurrentService.MapMode == MapMode.AddPoly;
            }

 
        }



      

    }
}
